1 // arcade controller thing
2 // Copyright (c) 2017 Clinton Ebadi <clinton@unknownlamer.org>
3 // GPLv3 or (at your option) any later version
4 // .. insert license text here ...
6 use <obiscad/bcube.scad>
7 use <obiscad/attach.scad>
11 rotate ([-10, 0, 0]) translate ([0, 0, box_h+20]) panel ();
21 box_h = 80; // fixme: box_d.
23 base_h = 5; //fixme: thickness?
25 // bcube parameters, clean up
35 module button (bezel = $button_d+4) {
45 for (x = [-js_width/2, js_width/2], y = [-js_height/2, js_height/2]) {
46 translate ([x, y, 0]) circle (d=bolt_d); // need slot instead
48 circle (d=center_hole_d);
50 %square ([js_width, js_height], center=true); // not right...
56 module case_base (h=base_h) {
57 bcube([panel_w, panel_h, h], cr, cres);
60 module case_walls () {
62 bcube([panel_w, panel_h, box_h-base_h], cr, cres);
63 bcube([panel_w-box_wall, panel_h-box_wall, box_h], cr, cres);
69 translate ([0, 0, (box_h)/2]) case_walls ();
78 linear_extrude (base_h*2,center=true) panel_layout ();
82 module panel_attach (position, angle=0) {
85 c1 = [ [x, y, base_h/2], [0,0,1], angle ]; //[0, 0, h];
86 a1 = [ [0,0, 0], [0,0,0], 0 ];
88 attach (c1, a1) children ();
91 // panel layout inspired by the Neo Geo layout
92 module panel_layout () {
93 translate ([-panel_w/2 + 40, 0, 0]) {
94 panel_attach ([0, 0], 90) joystick ();
96 // p1, coin (floating off in the distance...)
99 for (x = [0, $button_d+10]) {
100 panel_attach ([x, 90]) button ();
101 panel_attach ([x, 90]) button ();
108 panel_attach ([buttons_offset, 0]) button ();
109 for (i = [ 1 : 3 ]) {
110 panel_attach ([i*($button_d+10)+buttons_offset-5, 30]) button ();